<?php

/*
 * author : wiloke
 * author uri: wiloke.com
 * date: 04/26/2014
 * time: 07 AM
 */

$aAboutUs = get_post_meta($post->ID, $post->post_type, true);

$aAboutUs = isset($aAboutUs['aboutus']) ? $aAboutUs['aboutus'] : null;


$aAboutUs = wp_parse_args($aAboutUs, array('small_intro'=>'',  'aboutus_icon'=>array('fa fa-refresh'), 'aboutus_more' => array(' '), 'aboutus_description'=>array('Description'), 'fact_name'=>array('Title'), 'fact_total'=>array('Description'), 'fact_description'=>'Description', 'fact_title'=>'Title' ) );

?>


<div class="bt-reset">
    <div class="container-12-fluid">
        <div class="container-12-row">
            <?php
                foreach ($aAboutUs['aboutus_more'] as $k => $v) :
                    $v = ltrim($v);
                ?>
                <div class="clone-me wrap-delete large-4">

                        <div class="panel">

                            <div class="panel-heading">
                                <div class="panel-title">
                                    <?php echo !empty( $v ) ? $v : 'More Info'; ?>
                                </div>

                                <div class="panel-options">
                                       <a href="#" class="delele-this"><i class="fa fa-times"></i></a>
                                </div>
                            </div>

                            <div class="panel-body">

                                <div class="form-group">
                                    <label class="form-label">Icon</label>
                                    <div class="controls">
                                        <a class="available-panel thickbox" href="#TB_inline&width=570&height=600&inlineId=table-fa"><i class="is_icon <?php echo isset($aAboutUs['aboutus_icon'][$k]) ?  $aAboutUs['aboutus_icon'][$k] :  'fa fa-refresh'; ?>"></i></a>
                                        <input type="hidden" class="service_icon is_icon" name="aboutus[aboutus_icon][]" value="<?php echo $aAboutUs['aboutus_icon'][$k] ?>"/>
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="form-label">About</label>
                                    <div class="controls">
                                      <input type="text" class="form-control reset" name="aboutus[aboutus_more][]" value="<?php echo $v ?>">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="form-label">Writting an introduction</label>
                                    <div class="controls">
                                      <textarea class="service_description widefat reset" name="aboutus[aboutus_description][]" ><?php echo $aAboutUs['aboutus_description'][$k] ?></textarea>
                                    </div>
                                </div>

                            </div>
                        </div>
                </div>
            <?php
            endforeach;
            ?>
            <div class="bo-add-new wo-wrapclone">
                <div class="">
                    <button class="btn btn-blue aboutus wo-addmore" type="button">Add More</button>
                </div>
            </div>
        </div>
    </div>
</div>


